package com.xxx.corejava.day1028;

import java.util.Scanner;

public class Test1 {
    /*
        输入一个成绩[0,100]
        判断等级
        90~100 A
        80~89  B
        70~79  C
        60~69  D
        <60    E
     */
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);

        System.out.println("输入成绩【0-100】：");

        int score=sc.nextInt();

        System.out.println("score = " + score);

        //如果输入的分数不符合[0,100]
        if(score<0 || score>100){
            System.out.println("分数无效");
            //结束当前方法
//            return;
            //停止虚拟机
            System.exit(0);
        }



        System.out.println("判断等级");


        String level;

        switch (score/10){
            case 10 :
                level="A";
                System.out.println("10");
                break;
            case 9 :
                level="A";
                System.out.println("9");
                break;
            case 8 :
                level="B";
                System.out.println("8");
                break;
            case 7 :
                level="C";
                System.out.println("7");
                break;
            case 6 :
                level="D";
                System.out.println("6");
                break;
            default:
                level="E";
                System.out.println("default");
        }


        System.out.println("等级为："+level);








    }



}
